package com.gfm.story.interceptor;


import com.gfm.story.entity.user.User;

/**
 * ThreadLocal
 */
public class UserContext {
	private static final ThreadLocal<User> USER_HODLER = new ThreadLocal<>();

	/**
	 * 修改删除获取User
	 * @param user
	 */
	public static void setUser(User user){
		USER_HODLER.set(user);
	}

	public static void remove(){
		USER_HODLER.remove();
	}

	public static User getUser(){
		return USER_HODLER.get();
	}
}
